//
//  ZPBTwoCollectionViewCell.m
//  WZLProduct
//
//  Created by boys on 16/3/21.
//  Copyright © 2016年 HaiTeng. All rights reserved.
//

#import "ZPBTwoCollectionViewCell.h"

@implementation ZPBTwoCollectionViewCell

-(instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.bgImage = [[UIImageView alloc] init];
        _bgImage.backgroundColor =[UIColor redColor];
        [self.contentView addSubview:_bgImage];
        
        self.titleLabel =[[UILabel alloc] init];
        _titleLabel.backgroundColor = [UIColor blackColor];
        [self.contentView addSubview:_titleLabel];
        
        self.likeLabel = [[UILabel alloc] init];
        _likeLabel.backgroundColor = [UIColor yellowColor];
        [_bgImage addSubview:_likeLabel];
        
        self.aliLabel = [[UILabel alloc] init];
        _aliLabel.backgroundColor =[UIColor purpleColor];
        [_bgImage addSubview:_aliLabel];
        
        self.sImage = [[UIImageView alloc] init];
        _sImage.backgroundColor = [UIColor darkTextColor];
        [_bgImage addSubview:_sImage];
    }
    return self;
}






-(void)layoutSubviews {
    [super layoutSubviews];
    [_bgImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.offset(0);
        make.width.height.offset(kScreenWidth / 3 - 20);
    }];
    [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.right.offset(0);
        make.width.equalTo(_bgImage);
        make.height.offset(45);
    }];
    [_likeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.offset(3);
        make.right.offset(-5);
        make.width.offset(40);
        make.height.offset(15);
    }];
    [_sImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(_likeLabel);
        make.right.equalTo(self.likeLabel.mas_left).with.offset(-5);
        make.width.offset(15);
        make.height.equalTo(_likeLabel);
    }];
    [_aliLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(5);
        make.bottom.offset(-3);
        make.width.offset(50);
        make.height.offset(20);
    }];
}




@end
